package com.jt.demo3;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.naming.Context;

public class SpringAnno {
        public static void main(String[] args) {


//        ApplicationContext context=
//                new AnnotationConfigApplicationContext(SpringCarConfig.class);
//                Cat cat1 = context.getBean(Cat.class);
//                Cat cat2 = context.getBean(Cat.class);
//                Cat cat3 = context.getBean(Cat.class);
//                cat1.hello();
//                System.out.println(cat1);
//                System.out.println(cat2);
//                System.out.println(cat3);

                AnnotationConfigApplicationContext context=
                        new AnnotationConfigApplicationContext(SpringSnake.class);
                Snake snake = context.getBean(Snake.class);
                snake.eat();
                context.close();
        }

}
